"""
提交给AI-API校验是否符合简历要求
"""
import requests

url = 'http://47.115.227.229:8088/v1/chat-messages'
key = 'Bearer app-OZARtxoCeNWN2EfvbZcgJS28'


def get_api_ai(data):
    """
    :param data: 简历数据
    :return:
    """
    headers = {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer %s' % str(key)
    }
    payload = {
        "inputs": {},
        "query": str(data),
        "response_mode": "streaming",  # 响应模式
        "reset_context": True,  # 是否重置上下文
        "conversation_id": "",
        "user": "abc-1234"  # 自定义用户ID
    }

    response = requests.request("POST", url, json=payload, headers=headers)

    return response
